package controllers
{
	import com.axon.dataservices.helpers.AxDSUtils;
	import com.axon.mvc.patterns.command.AxSimpleCommand;
	
	import flash.display.DisplayObject;
	
	import models.vo.DocumentoApresentado;
	import models.vo.Pleito;
	
	import views.mediators.DoctoApresPopUpRegMediator;
	
	public class DocumentoApresentadoCommand extends AxSimpleCommand
	{
		//////////////////////////////////////////////////////////////////////////////////////////////////////
		
		public function execList(sender: Object, body: Object, extraInfo: Object): void
		{
			AppFacade(facade).documentoApresentadoProxy.list(body as Pleito);
		}

		//////////////////////////////////////////////////////////////////////////////////////////////////////
		
		public function execEdit( sender: Object, body: Object, extraInfo: Object ): void
		{
			AppFacade(facade).regMediator( 
				new DoctoApresPopUpRegMediator( DisplayObject(extraInfo), 
					AxDSUtils.clone(body) as DocumentoApresentado ) );
		}
		
		//////////////////////////////////////////////////////////////////////////////////////////////////////
		
		public function execSave( sender: Object, body: Object, extraInfo: Object ): void
		{
			AppFacade(facade).documentoApresentadoProxy.save( body as DocumentoApresentado );	
		}
		
	}
}